package com.hdd.utils;

import com.hdd.config.Constant;

import java.math.BigDecimal;

public class NumberUtils {

    /**
     * 计算费用
     * @param amount
     * @param rate
     * @return
     */
    public static String m1(Double amount,Double rate) {
        BigDecimal bg = new BigDecimal(amount-amount*rate);
        double f1 = bg.setScale(2, BigDecimal.ROUND_DOWN).doubleValue();
        return f1+"";
    }


    public static String m2(String amount,Double rate) {
        BigDecimal bg = new BigDecimal(Double.parseDouble(amount)*rate);
        double f1 = bg.setScale(2, BigDecimal.ROUND_DOWN).doubleValue();
        return f1+"";
    }


    public static String m3(String amount,String  amount2) {
        BigDecimal amt1 = new BigDecimal(amount);
        BigDecimal amt2 = new BigDecimal(amount2);
        return amt1.subtract(amt2).toString();
    }



    
}
